package com.unknowpupil.sell.utils;

import java.util.Random;

/**
 * @Classname: KeyUtil
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2019/12/30 1:52
 * @Description:
 * @Version: 1.0
 */
public class KeyUtil {
    /**
     * 生成唯一主键
     * 格式，时间+随机数
     */
    public static synchronized String genUniqueKey(){
        Random random = new Random();
        Integer number = random.nextInt(900000);
        return System.currentTimeMillis()+String.valueOf(number);
    }
}
